<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"
%><%@ taglib prefix="decorator" uri="http://www.opensymphony.com/sitemesh/decorator" 
%><%@ taglib prefix="tags" tagdir="/WEB-INF/tags"
%><%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"
%><%@ taglib prefix="security" uri="http://www.springframework.org/security/tags"
%><%@ taglib prefix="spring" uri="http://www.springframework.org/tags"
%><%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"
%><%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"
%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="content-type" content="text/html; charset=UTF-8">
		<title><decorator:title default="Springfuse"/></title>
		<meta name="generator" content="www.springfuse.com" />
		
		<link rel="shortcut icon" href="${pageContext.request.contextPath}/images/favicon.ico">

		<!-- yui reset css -->
		<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/reset-min.css">
		<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/fonts-min.css">
		
		<!-- button library -->
		<link href="${pageContext.request.contextPath}/css/sexybuttons/sexybuttons.css" rel="stylesheet"  type="text/css"/>

		<!-- jquery -->
		<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/jquery-ui-1.8/jquery.ui.all.css">
		<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-1.4.2.min.js"></script>
		<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-ui-1.8.min.js"></script>
		<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-validate-1.7.js"></script>
		<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-validate-1.7-localization/message_${pageContext.response.locale.language}.js"></script>

		<!-- our look -->
		<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/styles.css">

		<decorator:head/>

		<script type="text/javascript">
			function setupTabs() {
				$(".tabs").tabs({
					load: function(event, ui) {
						setupPage();
					}
				});
			}
			
			function setupValidation() {
				var validator = $("form").validate({
					wrapper: 'li'
				});
			}
		
			function setupDatepickers() {
				// see http://docs.jquery.com/UI/Datepicker/formatDate
				$(".datepicker").datepicker({dateFormat: 'yy-mm-dd'});
			}
		
			function setupAjaxLinks() {
				$(".ajaxLink").click(function(element) {
					$("#main").load($(this).attr("href") + " #main", function() { setupPage();});
					return false;
				});
				$(".ajaxModal").click(function(element) {
					$("#modalDialog").load($(this).attr("href") + " #main_body", function() {setupPage();});
					$("#modalDialog").dialog({modal: true});
					return false;
				});
			}
		
			function setupPage() {
				setupTabs();
				setupValidation();
				setupDatepickers();
				setupAjaxLinks();
			}
		
			$(document).ready(function(){
				setupPage();
			});
		</script>
	</head>
	<body>
		<div class="wrapper">
			<div id="header">
				<div id="navigation">
					<ul>
						<li>
							<a href="${pageContext.request.contextPath}/"><img src="${pageContext.request.contextPath}/images/logo_springfuse.png" width="197" height="50" class="left" style="position:relative;top:-12px;"></a>
						</li>
						<li>
							<tags:a cssClass="sexyyellow" href="http://www.springfuse.com/quickstart" key="layout.quickstart"/>
						</li>
					</ul>
					<div class="clear"></div> 
				</div>	
				<div id="lang">
					<ul>
						<li>
<security:authorize ifNotGranted="ROLE_USER">
							<tags:a cssClass="sexyorange" href="/login/" key="layout.login"/>
</security:authorize>
<security:authorize ifAllGranted="ROLE_USER">
							<tags:a cssClass="sexyorange" href="/logout" key="layout.logout"/>
</security:authorize>
						</li>
					</ul>
				</div>
			</div><!-- End id="header"-->
		</div><!-- End class="wrapper"-->		
		<div class="box_middle wrapper vertical_spacer">
			<div class="box_top"></div>
			<security:authorize ifAllGranted="ROLE_ADMIN">
				<div>
					<div class="box_products_left">
						<div id="navbar" class="top_border"> 
							<ul> 
								<li>
									<a href="<c:url value="/domain/account/index"/>">account</a> 
								</li>
								<li>
									<a href="<c:url value="/domain/address/index"/>">address</a> 
								</li>
								<li>
									<a href="<c:url value="/domain/book/index"/>">book</a> 
								</li>
								<li>
									<a href="<c:url value="/domain/document/index"/>">document</a> 
								</li>
								<li>
									<a href="<c:url value="/domain/role/index"/>">role</a> 
								</li>
							</ul> 
						</div>
					</div>
					<div id="main" class="box_products_right">
						<h1><decorator:title/></h1>
						<div id="main_body">
							<decorator:body />
						</div>
					</div>
				</div>
			</security:authorize>
			<security:authorize ifNotGranted="ROLE_ADMIN">
				<div id="main" class="box_inner">
					<h1><decorator:title/></h1>
					<div id="main_body">
						<decorator:body />
					</div>
				</div>
			</security:authorize>
			<div class="box_bottom"></div>
		</div>					
		<div class="wrapper">
			<div id="footer">
				Copyright &copy; 2005-2010 <a href="http://www.jaxio.com/">Jaxio</a> . <fmt:message key="layout.all.rights.reserved"/>
				| <a href="http://www.springfuse.com/privacy-policy"><fmt:message key="layout.privacy.policy"/></a>
				<br/>
				<a href="?locale=en" title="English"><img src="${pageContext.request.contextPath}/images/lang_english.png" height="18" width="18"></a>
				<a href="?locale=fr" title="French"><img src="${pageContext.request.contextPath}/images/lang_french.png" height="18" width="18"></a>
				<br/>
				<a href="http://www.twitter.com/springfuse"><img src="http://twitter-badges.s3.amazonaws.com/follow_bird_us-b.png" alt="Follow springfuse on Twitter"/></a>
			</div>
		</div>
		<div id="modalDialog"></div>
		<script type="text/javascript">
			// example with asynchronous google analytics
			var _gaq = _gaq || [];
			_gaq.push(['_setAccount', 'UA-166864-24']); // change with your google id
			_gaq.push(['_setCustomVar', 1, 'rootPackage', 'com.company.project', 1]); // example of user defined variable
			_gaq.push(['_trackPageview']);
			
			(function() {
			var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
			ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
			var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
			})();
		</script>
	</body>
</html>